<?php /* Smarty version 2.6.18, created on 2010-03-16 09:23:49
         compiled from vieworderdetails.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'explode', 'vieworderdetails.tpl', 63, false),array('modifier', 'number_format', 'vieworderdetails.tpl', 70, false),array('function', 'cycle', 'vieworderdetails.tpl', 66, false),)), $this); ?>
<form name="mainForm" method="POST" id="mainForm">
		<input type="hidden" name="supplier_org_id" value="<?php echo $this->_tpl_vars['supplier_org_id']; ?>
">
		<input type="hidden" name="poid" value="<?php echo $this->_tpl_vars['poid']; ?>
">
    	<h1>Order Details</h1>
        <div class="blue">
		<p class="right"><input id="order" style="visibility:hidden" type="button" value="Resend Order" onclick="doajaxAction('/account/resendOrder/',1,'main_content',document.getElementById('mainForm'));">&nbsp;<input type="button" value="Back to View Order" onclick="doajaxAction('/account/viewOrders',0,'main_content');" /></p>
        </div>
           
            <div id="results">
				
                <!-- **************repeat here*************** -->
                
                <div>  
					<?php $this->assign('count', 0); ?>
					<?php if ($this->_tpl_vars['orders']): ?>
					<?php $_from = $this->_tpl_vars['orders']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['keys'] => $this->_tpl_vars['items']):
?>
						<?php if ($this->_tpl_vars['count'] == 0): ?>
						<input type="checkbox" value="1" name="blanket_po" <?php if ($this->_tpl_vars['items']['blanketpo']): ?>checked<?php endif; ?>><strong>Is Blanket P.O.</strong>
						<?php if ($this->_tpl_vars['items']['blanketpo']): ?>				
						<script languag	e="javascript">
							document.getElementById("order").style.visibility = 'visible';
						</script>	
						<?php endif; ?>			
						<?php endif; ?>				
					<?php $this->assign('count', ($this->_tpl_vars['count']+1)); ?>				
					<?php if ($this->_tpl_vars['items']['totalorder'] > 0 && $this->_tpl_vars['keys'] != 'blanketpo'): ?>
					<table border="0" width="100%">
						<tr>
                    			<th colspan="6">&nbsp;</th>
						</tr>						
						<tr>
							<td colspan="2">
								<table border="0" width="100%">
									<tr height="30">
										<td width="20%">Po No.</td>
										<td>: <?php echo $this->_tpl_vars['poid']; ?>
</td>
									</tr>
									<tr height="30">
										<td>Supplier name</td>
										<td>: <?php echo $this->_tpl_vars['items']['supplier']; ?>
</td>
									</tr>									
								</table>
							</td>
							<td>&nbsp;</td>							
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>							
						</tr>						
						<tr><td colspan="8"><hr></td></tr>
						<tr>
							<td></td>
							<td>Name</td>
							<td>Size</td>
							<td>Qty</td>
							<td>Price</td>
							<td>Cost</td>
						</tr>
						<tr><td colspan="8"><hr></td></tr>
						 <?php $this->assign('grandtotal', 0); ?>
						 <?php $_from = $this->_tpl_vars['items']['organismItem']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['item']):
?>
							<?php $this->assign('supplier', ($this->_tpl_vars['item']['org_id'])); ?>
							<?php $_from = $this->_tpl_vars['item']['order']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['detail']):
?>
								<?php $this->assign('orderkey', ((is_array($_tmp='_')) ? $this->_run_mod_handler('explode', true, $_tmp, $this->_tpl_vars['key']) : explode($_tmp, $this->_tpl_vars['key']))); ?>
								<?php $this->assign('sizekey', $this->_tpl_vars['orderkey']['0']); ?>
								
								 <tr class=<?php echo smarty_function_cycle(array('values' => "blue,notify"), $this);?>
>	
									<td width="10%" align="center"><img  onclick="PopEx(this, null, null, null, 300, 50, 'PopBoxImageLarge');" pbCaption="<i><?php echo $this->_tpl_vars['item']['scientific_name']; ?>
</i>, <?php echo $this->_tpl_vars['item']['common_name']; ?>
" id="trade<?php echo $this->_tpl_vars['item']; ?>
" width="50" src="/app/default/www/images/thumbs/<?php echo $this->_tpl_vars['item']['image']; ?>
.jpg" pbsrc="/app/default/www/images/thumbs/<?php echo $this->_tpl_vars['item']['image']; ?>
.jpg" class="PopBoxImageSmall" title="Click to magnify/shrink"></td>                         
									<td>MOID:<?php echo $this->_tpl_vars['item']['moid']; ?>
<br> <i><?php echo $this->_tpl_vars['item']['scientific_name']; ?>
</i><br><?php echo $this->_tpl_vars['item']['name']; ?>
</td>
									<td><?php echo $this->_tpl_vars['size'][$this->_tpl_vars['sizekey']]; ?>
</td>
									<td align="right"><?php echo ((is_array($_tmp=$this->_tpl_vars['detail'])) ? $this->_run_mod_handler('number_format', true, $_tmp, '2%d') : number_format($_tmp, '2%d')); ?>
</td>
									<td align="right"><?php echo ((is_array($_tmp=$this->_tpl_vars['item']['price'])) ? $this->_run_mod_handler('number_format', true, $_tmp, '2%d') : number_format($_tmp, '2%d')); ?>
</td>
									<?php $this->assign('totalamount', ($this->_tpl_vars['item']['price']*$this->_tpl_vars['detail'])); ?>
									<?php $this->assign('grandtotal', ($this->_tpl_vars['grandtotal']+$this->_tpl_vars['totalamount'])); ?>
									<td align="right"><?php echo ((is_array($_tmp=$this->_tpl_vars['totalamount'])) ? $this->_run_mod_handler('number_format', true, $_tmp, '2%d') : number_format($_tmp, '2%d')); ?>
</td>
									
								  </tr>
							  <?php endforeach; endif; unset($_from); ?>
						 <?php endforeach; endif; unset($_from); ?>
							 <tr>
							 	<td colspan="6">&nbsp;</td>
							 </tr>			
							 <tr>
							 	<td colspan="6">&nbsp;</td>
							 </tr>	
							 <tr>
							 	<td colspan="6">&nbsp;</td>
							 </tr>							 						 			 
							 <tr style="background-color: #BEBEBE;">
								<td>&nbsp;</td>
								<td>&nbsp;</td>
								<td>&nbsp;</td>
								<td>&nbsp;</td>
								<td>&nbsp; Total amount : </td>
								<td align="right"><?php echo ((is_array($_tmp=$this->_tpl_vars['grandtotal'])) ? $this->_run_mod_handler('number_format', true, $_tmp, '2%d') : number_format($_tmp, '2%d')); ?>
</td>								
							 </tr>						 
                     </table>
                     <?php endif; ?>
					 <?php endforeach; endif; unset($_from); ?>
					 <?php else: ?>
						 <table width="100%">
							<tr>
                    			<th colspan="2">Empty Shopping Cart</th>
							</tr>
						 </table>
					 <?php endif; ?>
            	</div>                
            </div>
</form>
            